﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'laydate', 'commonTable', 'table', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            laydate = layui.laydate,
            table = layui.table,
            commonTable = layui.commonTable,
            common = layui.common;
        var keyValue = $.request("keyValue");
        //权限字段
        common.authorizeFields('adminform');
        var listData = [];
        $(function () {
            initControl();
            if (!!keyValue) {
                common.ajax({
                    url: '/PlanManage/Order/GetFormJson',
                    dataType: 'json',
                    data: { keyValue: keyValue },
                    async: false,
                    success: function (data) {
                        common.val('adminform', data);
                        common.setReadOnly('adminform');
                        listData = data.list;
                    }
                });
            }
            commonTable.rendertable({
                elem: '#currentTableId',
                data: listData,
                defaultToolbar: [],
                toolbar:  '',//工具栏
                search: false,
                limit: 9999,//每页数据 默认
                page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                    layout: ['count'] //自定义分页布局
                    , first: false //不显示首页
                    , last: false //不显示尾页
                },
                height: 'full-225',
                filter: {
                    clearFilter: false,
                },
                cols: [[
                    { field: 'F_MaterialCode', title: '物料编号', minWidth: 145, sort: true },
                    { field: 'F_MaterialName', title: '物料名称', minWidth: 145, sort: true },
                    { field: 'F_NeedNum', title: '需求数量', width: 150, sort: true },
                    { field: 'F_DoneNum', title: '交付数量', width: 150, sort: true },
                ]]
            });
            form.render();
        });
        wcLoading.close();
        function initControl() {
            //此处需修改
            //绑定数据源
            //类型为下拉框时
        }
    });
</script>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form" lay-filter="adminform">
                <div class="layui-form-item">
                    <div class="layui-col-md6 layui-col-sm6 layui-hide">
                        <label class="layui-form-label">订单编号</label>
                        <div class="layui-input-block">
                            <input type="text" id="F_OrderCode" name="F_OrderCode" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-col-md6 layui-col-sm6 layui-hide">
                        <label class="layui-form-label">客户</label>
                        <div class="layui-input-block">
                            <input id="F_Customer" name="F_Customer" type="text" class="layui-input" />
                        </div>
                    </div>
                </div>
                <div class="layui-form-item" id="test6">
                    <div class="layui-col-md6 layui-col-sm6 layui-hide">
                        <label class="layui-form-label">开始日期</label>
                        <div class="layui-input-block">
                            <input id="F_PlanStartTime" name="F_PlanStartTime" type="text" maxlength="50" class="layui-input" />
                        </div>
                    </div>
                    <div class="layui-col-md6 layui-col-sm6 layui-hide">
                        <label class="layui-form-label">结束日期</label>
                        <div class="layui-input-block">
                            <input id="F_PlanEndTime" name="F_PlanEndTime" type="text" maxlength="50" class="layui-input" />
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-md12 layui-col-sm12 layui-hide">
                        <label class="layui-form-label">选项</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="F_EnabledMark" id="F_EnabledMark" disabled value="true" title="有效标识">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-md12 layui-col-xs12 layui-hide">
                        <label class="layui-form-label">备注</label>
                        <div class="layui-input-block">
                            <input id="F_Description" name="F_Description" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-md12 layui-col-sm12">
                        <label class="layui-form-label">需求列表</label>
                        <div class="layui-input-block">
                            <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

